ruby:
  debug_files = app.debug_files.where(device_type: value).order(id: :desc)

.tab-pane id="tab-#{app.id}-#{value.downcase}" class="#{i == 0 ? 'active' : ''}"
  - if debug_files.count > 0
    table.table.table-hover
      - debug_files.each do |debug_file|
        tr[
          data-controller="destroy"
          data-destroy-title-value="#{t('debug_files.confirm.destroy.title')}"
          data-destroy-content-value="#{t('debug_files.confirm.destroy.body')}"
          data-destroy-cancel-value="#{t('debug_files.confirm.destroy.cancel')}"
        ]
          td
            .debug-file-section data-controller="debug-file"
              .debug-file-section-header
                .debug-file-toggle data-action="click->debug-file#toggle"
                  h3.debug-file-section-title
                    - unless debug_file.build_version.blank?
                      span.debug-file-version
                        = debug_file.release_version
                    span.debug-file-device-type
                      = device_name(debug_file.device_type)
                  .debug-file-build-version
                    - if debug_file.build_version.blank?
                      = t('debug_files.index.processing')
                    - else
                      = t('debug_files.index.version', version: debug_file.build_version)

                .debug-file-section-size
                  - if debug_file.file?
                    a.btn.btn-icon.btn-sm.btn-success.btn-flat href="#{debug_file.file_url}" target="_blank"
                      i.icon.fas.fa-download
                      = t('debug_files.index.download', size: number_to_human_size(debug_file.file.size))
                  - else
                    button.btn.btn-secondary.btn-icon.btn-sm.btn-flat.disabled
                      i.icon.fas.fa-ghost
                      = t('debug_files.index.missing_file')
                  - if user_signed_in?
                    button.btn.btn-icon.btn-sm.btn-danger.btn-flat[
                      data-action="click->destroy#click"
                    ]
                      i.icon.fas.fa-trash-alt
                      = t('debug_files.index.destroy')

                    = button_to t('debug_files.confirm.destroy.ok'), debug_file_path(debug_file), method: :delete, \
                      class: 'btn btn-danger d-none', form: { data: { 'destroy-target' => 'destroyButton' } }
                  .div.text-center
                    small style="color: #999"
                      = t('debug_files.index.uploaded_at', time: time_ago_in_words(debug_file.created_at))

              == render 'metadata', debug_file: debug_file
  - else
    .alert
      = t('debug_files.index.empty_content')